//
// Created by admin on 2023-6-21.
//

#include "init_member.h"

#include <iostream>

std::ostream& operator<<(std::ostream& os, const S4& rhs) {
    return os << "s4("
              << rhs.x << ", "
              << rhs.y << ", "
              << rhs.s << ")\n ";
}

/// An aggregate is an array or a class ([class]) with
///
/// (1.1) no user-declared or inherited constructors ([class.ctor]),
/// (1.2) no private or protected direct non-static data members ([class.access]),
/// (1.3) no virtual functions ([class.virtual]), and
/// (1.4) no virtual, private, or protected base classes ([class.mi]).

int main()
{
    std::cout << A().SetX(2).x
              << "\n"
              << A().SetY(2).y
              << "\n"
              << A().SetZ(2).z
              << "\n";

    // Number<42>() 不能调用delete的构造函数
    std::cout << (wrappedValueIsN(Number<1>::get()) ? "YES":"NO")
            << "\n"
            << Number<2>::get().value
            << "\n";
    using std::cout;
    cout << "\n"
         << S4(10).x
         << "\n"
         << S4(2.1).y
         << "\n"
         << S4("2.1s").s
         << "\n";
    S4 s4{1, 2.0, "string"};
    cout << s4;
    return 0;
}
